package game;
import java.util.Scanner;

import ttt.BoardEvaluator;
import ttt.TicTacToe;

import node.Node;

public class TicTacToePlayer implements Node {

	private BoardEvaluator eval = 
		new BoardEvaluator();
	
	public Node copyNode() {
		return null;
	}
	
	public void display(int i) {
		return;
	}
	
	public int evaluate(int[] board) {
		int[][] b = eval.toBoard(board);
		
		for(int i = 0; i < 3; i++) {
			for(int j = 0; j < 3; j++) {
				if(b[i][j] == TicTacToe.X_MARK)
					System.out.print("X");
				else if(b[i][j] == TicTacToe.O_MARK)
					System.out.print("O");
				else
					System.out.print(" ");
			}
			System.out.println();
		}
		
		System.out.print("Enter move: ");
		
		Scanner scan = new Scanner(System.in);
		int move = scan.nextInt();
		return move;
	}
}
